@use './src/styles/vendor/variables' as vv;

/* Reset checkbox success color */
.was-validated .custom-control-input:valid,
.custom-control-input.is-valid {
  ~ .custom-control-label {
    color: initial;
  }

  &:checked ~ .custom-control-label::before {
    background-color: $component-active-bg;
    border-color: $custom-control-indicator-checked-border-color;
  }

  ~ .custom-control-label::before {
    border-color: $custom-control-indicator-border-color;
  }

  &:focus ~ .custom-control-label::before {
    box-shadow: $custom-control-indicator-focus-box-shadow;
  }

  &:focus:not(:checked) ~ .custom-control-label::before {
    border-color: $custom-control-indicator-focus-border-color;
  }
}

/* Buttons */
.btn-light {
  background-color: vv.$white;
  border-color: vv.$gray-400 !important;

  &:hover {
    background-color: vv.$gray-300;
    border-color: vv.$gray-600 !important;
  }

  &:disabled {
    background-color: vv.$gray-200;
    border-color: vv.$gray-400 !important;
  }
}

// We have some inputs that don't have a corresponding formControlName,
// to be able to get the same styling and no JS errors we need use a different
// class name
.cd-form-control {
  @extend .form-control;
}

.btn {
  &,
  &:active,
  &.active {
    &:focus,
    &.focus {
      outline: 0;
    }
  }

  &.disabled {
    border: 0;
    box-shadow: none;
  }
}

.btn-primary .badge {
  background-color: vv.$gray-200;
  color: vv.$primary;
}

.btn-group > .btn > i.fa,
.cd-datatable-actions button.btn i.fa {
  /** Add space between icon and text */
  margin-right: 5px;
}

.card-footer button.btn:not(:first-child) {
  margin-left: 5px;
}
